<?php

/**
 * ReferentielMantis filter form base class.
 *
 * @package    kc_report_proto
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseReferentielMantisFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'rma_libelle'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_lien'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_hostname'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_database'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_username'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_password'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_enum_severite'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_enum_statut'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_enum_resolution'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_sev_mineur'       => new sfWidgetFormFilterInput(),
      'rma_sev_majeur'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_sev_bloquant'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_sta_detecte'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_sta_resolu'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_sta_livre'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_sta_ferme'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rma_enum_sta_attente' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'rma_libelle'          => new sfValidatorPass(array('required' => false)),
      'rma_lien'             => new sfValidatorPass(array('required' => false)),
      'rma_hostname'         => new sfValidatorPass(array('required' => false)),
      'rma_database'         => new sfValidatorPass(array('required' => false)),
      'rma_username'         => new sfValidatorPass(array('required' => false)),
      'rma_password'         => new sfValidatorPass(array('required' => false)),
      'rma_enum_severite'    => new sfValidatorPass(array('required' => false)),
      'rma_enum_statut'      => new sfValidatorPass(array('required' => false)),
      'rma_enum_resolution'  => new sfValidatorPass(array('required' => false)),
      'rma_sev_mineur'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rma_sev_majeur'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rma_sev_bloquant'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rma_sta_detecte'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rma_sta_resolu'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rma_sta_livre'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rma_sta_ferme'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rma_enum_sta_attente' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('referentiel_mantis_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ReferentielMantis';
  }

  public function getFields()
  {
    return array(
      'rma_id'               => 'Number',
      'rma_libelle'          => 'Text',
      'rma_lien'             => 'Text',
      'rma_hostname'         => 'Text',
      'rma_database'         => 'Text',
      'rma_username'         => 'Text',
      'rma_password'         => 'Text',
      'rma_enum_severite'    => 'Text',
      'rma_enum_statut'      => 'Text',
      'rma_enum_resolution'  => 'Text',
      'rma_sev_mineur'       => 'Number',
      'rma_sev_majeur'       => 'Number',
      'rma_sev_bloquant'     => 'Number',
      'rma_sta_detecte'      => 'Number',
      'rma_sta_resolu'       => 'Number',
      'rma_sta_livre'        => 'Number',
      'rma_sta_ferme'        => 'Number',
      'rma_enum_sta_attente' => 'Text',
    );
  }
}
